package com.qianxunclub.util;

/**
 * Created by zhangbin on 2017/3/6.
 */
public enum ReturnCode {
    CODE_1000(1000, "成功"),
    CODE_1001(1001, "无权限访问"),
    CODE_1002(1002, "信息不存在"),
    CODE_1003(1003, "信息已存在"),
    CODE_1004(1004, "参数不全"),
    CODE_1005(1005, "服务器处理异常"),
    CODE_1006(1006, "失败"),
    CODE_1007(1007, "登出成功"),
    CODE_1008(1008, "需要登录");

    /**
     * 业务编号
     */
    private Integer code;

    /**
     * 业务值
     */
    private String message;

    ReturnCode(Integer code, String value) {
        this.code = code;
        this.message = value;
    }

    public final Integer code() {
        return code;
    }

    public final String message() {
        return message;
    }

    @Override
    public String toString() {
        return this.code + "=" + this.message;
    }
}
